asm
  ld sp,$87FF
  end asm

#include "./library/pacmandelay.bas"
#include "./library/smsrnd.bas"


dim eee as uinteger at $8010
dim seed as uinteger at $8012
dim ee1 as uinteger at $8014
dim ee2 as uinteger at $8016
dim ee3 as uinteger at $8018
dim ee4 as uinteger at $801A
dim ex0 as uinteger at $801C
dim ey0 as uinteger at $801E


sub strategyxputchar(txp1 as uinteger,typ1 as uinteger,tch1 as ubyte):
  poke $9000+(typ1*32)+txp1,tch1
  end sub

sub strategyxputattr(txp1 as uinteger,tvl1 as ubyte):
  poke $8801+(txp1*2),tvl1
  end sub

sub strategyxscroll(txp1 as uinteger,tvl1 as ubyte):
  poke $8800+(txp1*2),tvl1
  end sub

sub strategyxputsprite(tly1 as uinteger,txp1 as ubyte,typ1 as ubyte,tch1 as ubyte,tat1 as ubyte):
  poke $8840+(tly1*4),typ1 bxor 255
  poke $8841+(tly1*4),tch1
  poke $8842+(tly1*4),tat1
  poke $8843+(tly1*4),txp1
  end sub



seed=0

for eee=$9000 to $93FF '- chr
  seed=smsrnd(seed)
  poke eee,seed band 3
  next

for eee=$8801 to $883F step 2 '- attr?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8840 to $88FF '- sprites?
  seed=smsrnd(seed)
  poke eee,seed
  next

for ee1=0 to 15
  for ee2=0 to 15
    strategyxputchar(ee2+15,ee1+13,ee1*16+ee2)
    next:next

ex0=64:ey0=64

eee=0
do

strategyxputchar(2,4,48+(int(eee/100) mod 10))
strategyxputchar(3,4,48+(int(eee/10) mod 10))
strategyxputchar(4,4,48+(eee mod 10))

for ee2=0 to 3
  ee1=peek($A000+(ee2*4)) bxor $FF '-($A000..$A00F,$A800..$A80F)
  strategyxputchar(2,6+ee2,48+(int(ee1/100) mod 10))
  strategyxputchar(3,6+ee2,48+(int(ee1/10) mod 10))
  strategyxputchar(4,6+ee2,48+(ee1 mod 10))
  next

for ee2=0 to 3
  ee1=peek($A800+(ee2*4)) bxor $FF '-($A000..$A00F,$A800..$A80F)
  strategyxputchar(2,11+ee2,48+(int(ee1/100) mod 10))
  strategyxputchar(3,11+ee2,48+(int(ee1/10) mod 10))
  strategyxputchar(4,11+ee2,48+(ee1 mod 10))
  next


ee3=peek($A000)
ee4=peek($A008)

ex0=ex0-((ee3 band 16)/16)+((ee3 band 32)/32)
ey0=ey0+((ee4 band 16)/16)-((ee4 band 64)/64)


for ee2=0 to 1
  for ee1=0 to 3
    strategyxputsprite(ee2*4+ee1,(ee1*16)+ex0,(ee2*16)+ey0,eee,eee)
    next:next


eee=eee+1

loop


'--------------------------------------------------------


do

for eee=$9000 to $93FF '- chr
  seed=smsrnd(seed)
  poke eee,seed
  pacmandelay(1000)
  next

for eee=$8801 to $883F step 2 '- attr?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8840 to $88FF '- sprites?
  seed=smsrnd(seed)
  poke eee,seed
  next


loop

do


for eee=$8800 to $883F step 2 '- scroll
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8801 to $883F step 2 '- attr?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8840 to $88FF '- sprites?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8900 to $89FF '- ?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8A00 to $8AFF '- ?
  seed=smsrnd(seed)
  poke eee,seed
  next

for eee=$8B00 to $8BFF '- ?
  seed=smsrnd(seed)
  poke eee,seed
  next


loop




for eee=$8800 to $8BFF '- sprites? attr?
  seed=smsrnd(seed)
  poke eee,seed
  next


for eee=$8C00 to $8FFF
  seed=smsrnd(seed)
  poke eee,seed
  next


for eee=$9000 to $93FF '- chr
  seed=smsrnd(seed)
  poke eee,seed
  pacmandelay(1000)
  next


for eee=$9400 to $97FF '- chr mirror?
  seed=smsrnd(seed)
  poke eee,seed
  next




do

for eee=$8800 to $8BFF
  seed=smsrnd(seed)
  poke eee,seed
  next

loop



do:loop


'for eee=$9800 to $FFFF
'  seed=smsrnd(seed)
'  poke eee,seed
'  next



